/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Test;

import Services.Sintaxis;
import java.util.ArrayList;

/**
 *
 * @author Oswaldo.C
 */
public class TestSintaxis {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {



       String codigo = "#include <stdio.h>\n"
                     + "#include <stdlib.h>\n"

                     + "int main(){\n"

                     + "for (int i = 0; i != 9; i++){\n"
                     +   " int x = 6;\n"
                     +  "  y = 7;\n"
                     +  "  if ( x == 6)\n"
                      +  "     printf (\"Soy un 6\");\n"
                      + "}\n"
                     + "system (\"PAUSE\");\n"
                     + "}\n";

       Sintaxis sint = new Sintaxis();

       ArrayList<String> modif = sint.generaEjercicio(codigo);

       System.out.println( modif.size() );

       for (int i = 0; i < modif.size() ; i++){
          System.out.print( modif.get(i) );
          //System.out.println(i);
       }


       /*al =  Sintaxis.toStringArray();
       for (int i = 0; i < al.size(); i++)
          System.out.print ( al.get(i)  );

        */

       //Sintaxis sint = new Sintaxis();

      //ArrayList<String> al = sint.generaEjercicio("#include <stdio.h>\n#include <math.h>\n#include <stdlib.h>\nint main(){\nprintf (\"Este es mi primer programa en C\");\n"
              //               + "int include = 0;\n"
              //               + "system (\"PAUSE\");\n"
              //               + "return 0;\n}\n");


       //for (int i=0; i < al.size() ; i++){
       //   System.out.print(al.get(i));
       //}
       
       //System.out.println (  sint.introduceError( "#include<stdio.h>\nint main(){ if (k != 0) printf (\"hola mundo\"); return 0}" , 4 ));
       //ArrayList<String> a =sint.generaEjercicio( "#include<stdio.h>\nint main(){ if (k != 0) printf (\"hola mundo\"); return 0}\n" );
       //for (int i=0; i < a.size(); i++)
         // System.out.println(a.get(i));


       //Sintaxis.toStringArray("#include<stdio.h>\nint main(){ if (k != 0) printf (\"hola mundo\"); return 0;}\n");
       //System.out.println("#include<stdio.h>\nint main(){  printf (\"hola mundo\"); return 0;}");
       //System.out.println("#include<stdio.h>\nint main(){  printf (\"hola mundo\"); return 0;}");

    } //fin main

} //fin clase TestSintaxis
